package model.world;

import java.awt.Point;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * This class implements the game's world.
 * 
 * @author Urbanek Lucas (aka NaG)
 */
public class CSWorld implements Serializable {
	
	private List<CSPlayer> players;
	
	/**
	 * The builder needs the roundtime and the
	 * spawns list.
	 * 
	 * @param roundTime
	 * @param spawns
	 */
	public CSWorld(double roundTime, List<Point> spawns) {
		
		players = new ArrayList<CSPlayer>();
		
		for (int i=0; i<5; i++)
			players.add(new CSPlayer("Player"+(i+1), roundTime, spawns.get(i))); // TODO ONLY KEEP SPAWN.GET(I) !!

	}
	
	public List<CSPlayer> getPlayers() {
		return players;
	}
	
	public CSPlayer getPlayer(int i) {
		if (i<0 || i>4)
			return null;
		return players.get(i);
	}
}
